using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration; using Sispe.Entities;

namespace Sispe.Repository.Mapping
{
    public class MENUMap : EntityTypeConfiguration<MENU>
    {
        public MENUMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.Descripcion)
                .IsRequired()
                .HasMaxLength(100);

            this.Property(t => t.Comentario)
                .HasMaxLength(200);

            // Table & Column Mappings
            this.ToTable("MENU");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.Descripcion).HasColumnName("Descripcion");
            this.Property(t => t.Tag).HasColumnName("Tag");
            this.Property(t => t.Comentario).HasColumnName("Comentario");
        }
    }
}
